<?php

use Illuminate\Support\Str;
use Faker\Generator as Faker;
use App\Models\Article;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
//生成模拟数据的工厂格式
$factory->define(Article::class, function (Faker $faker) {
    return [
        'title' => $faker->title,
        'desc' => $faker->word,
        'pic' => '/iploads/article/'.rand(1,6).'.jpg',
        'body' => $faker->text
    ];
});
